<!DOCTYPE html>
<html lang="#{localeController.language}" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.prime.com.tr/ui" 
xmlns:ui="http://java.sun.com/jsf/facelets">
	<f:view locale="#{localeController.locale}">
		<h:head>
			<link href="resources/css/style.css" rel="stylesheet" />
			<meta charset="utf-8" />
			<title>Testato | <ui:insert name="title"></ui:insert> </title>
		</h:head>
		<h:body styleClass="body">
			<p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();" />
			<p:dialog closable="true" draggable="false" header="#{msgs.loading}" modal="true" resizable="false" styleClass="center" widgetVar="statusDialog">
                <p:graphicImage value="resources/images/ajaxLoader.gif" />
            </p:dialog>
			<p:outputPanel layout="block" styleClass="background">
				<p:outputPanel layout="block" styleClass="pageBody">
					<p:outputPanel layout="block" styleClass="radiusContent">
						<p:outputPanel layout="block" styleClass="header">
							<p:outputPanel layout="block" styleClass="topRightHeader">
								<h:outputLink value="http://www.w3.org/html/logo/">
									<h:graphicImage alt="#{msgs.html5powered}" title="#{msgs.html5powered}" url="resources/images/logoHtml5.png" />
								</h:outputLink>
							</p:outputPanel>
							<h:panelGrid columns="2" styleClass="bottomHeader">
								<p:outputPanel layout="block" styleClass="bottomLeftHeader">
									<h:form id="languagesForm">
										<h:commandLink action="#{localeController.onNavigationCompute}" actionListener="#{localeController.navigationCompute}">
											<f:param name="#{localeController.attributeLocale}" value="fr" />
											<h:graphicImage alt="#{msgs.locale_fr}" title="#{msgs.locale_fr}" url="resources/images/flagFrance.png" />
										</h:commandLink>
										<h:commandLink action="#{localeController.onNavigationCompute}" actionListener="#{localeController.navigationCompute}">
											<f:param name="#{localeController.attributeLocale}" value="en" />
											<h:graphicImage alt="#{msgs.locale_en}" title="#{msgs.locale_en}" url="resources/images/flagUk.png" />
										</h:commandLink>
									</h:form>
								</p:outputPanel>
								<p:outputPanel layout="block" styleClass="bottomRightHeader">
									<h:panelGrid columns="#{(null != sessionController.sessionUser)?10:2}" styleClass="bottomRightHeaderItem">
										<h:graphicImage alt="#{msgs.currentUser}" rendered="#{null != sessionController.sessionUser}"  title="#{msgs.currentUser}" url="resources/images/userIcon.png"/>
										<h:outputText rendered="#{null != sessionController.sessionUser}" value="#{sessionController.sessionUser.lastName} #{sessionController.sessionUser.name}"/>
										<h:graphicImage alt="#{msgs.userJob}" rendered="#{null != sessionController.sessionUser}"  title="#{msgs.userJob}" url="resources/images/jobIcon.png"/>
										<h:outputText rendered="#{null != sessionController.sessionUser}" value="#{sessionController.sessionUser.job}"/>
										<h:graphicImage alt="#{msgs.service}" rendered="#{null != sessionController.sessionUser}"  title="#{msgs.service}" url="resources/images/serviceIcon.png"/>
										<h:outputText rendered="#{null != sessionController.sessionUser}" value="#{sessionController.sessionUser.service.label}"/>
										<h:graphicImage alt="#{msgs.currentDate}" title="#{msgs.currentDate}" url="resources/images/dateIcon.png"/>
										<h:outputText value="#{sessionController.currentTimestamp}">
											<f:convertDateTime dateStyle="medium" locale="#{localeController.locale}" />
										</h:outputText>
										<h:graphicImage alt="#{msgs.logout}" rendered="#{null != sessionController.sessionUser}"  title="#{msgs.logout}" url="resources/images/logoutIcon.png"/>
										<h:outputLink rendered="#{null != sessionController.sessionUser}" styleClass="link" value="#{request.contextPath}/j_spring_security_logout">
											<h:outputText value="#{msgs.logout}"/>
										</h:outputLink>
									</h:panelGrid>
								</p:outputPanel>
							</h:panelGrid>
						</p:outputPanel>
					</p:outputPanel>
					<p:outputPanel layout="block" styleClass="radiusContent">
						<p:outputPanel layout="block" styleClass="content">
							<ui:insert name="bodyInclude"></ui:insert>
						</p:outputPanel>
					</p:outputPanel>
					<p:outputPanel layout="block" styleClass="radiusContent">
						<p:outputPanel layout="block" styleClass="footer">
							<h:outputText value="&#169; Copyright Che Software 2011 - #{msgs.allRightsReserved} - #{msgs.gnuLicense}" />
						</p:outputPanel>
					</p:outputPanel>
				</p:outputPanel>
			</p:outputPanel>
			<h:outputScript target="head">
				function handleSaveRequest(xhr, status, args, dialog){
					if(args.validationFailed || args.notValid){
						return false;
					}
					dialog.hide();
					return false;
				}
			</h:outputScript>
		</h:body>
	</f:view>
</html>